package com.jx.pxxy;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

public class NewsActivity extends AppCompatActivity {

    private static final String TAG = "NewsActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);
        Log.d(TAG,"onCreate........");
    }

    @Override
    protected void onStart() {
        Log.d(TAG,"onStart........");
        super.onStart();
    }

    @Override
    protected void onResume() {
        Log.d(TAG,"onResume........");
        super.onResume();
    }

    @Override
    protected void onPause() {
        Log.d(TAG,"onPause........");
        super.onPause();
    }

    @Override
    protected void onStop() {
        Log.d(TAG,"onStop........");
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        Log.d(TAG,"onDestroy........");
        super.onDestroy();
    }



    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(1,1,1,"跳转UserActivity");
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(@NonNull MenuItem item) {
        switch (item.getItemId()){
            case 1:
                Intent intent2 = new Intent(NewsActivity.this, UserActivity.class);
                startActivity(intent2);
                break;

        }
        return super.onOptionsItemSelected(item);
    }
}
